$(document).ready(function () { // Define the maintenance window (start and end date) var now = new Date(); var start = new Date('2026-07-29T00:00:00'); var end = new Date('2026-09-01T23:59:59'); // Check if the current time is within the defined maintenance period var isWithinDate = now >= start && now <= end; // Check if the current page is the single checkout page (EN or DE) var isOnCheckoutPage = window.location.href.includes("single_checkout.aspx"); // Only proceed if both date and page match if (isWithinDate && isOnCheckoutPage) { // Select the real checkout button (both English and German label) var realBtn = document.querySelector("input[type='submit'][value='Checkout'], input[type='submit'][value='Kasse']"); if (realBtn) { // Ensure the parent container is relatively positioned (required for tooltip positioning) var parent = realBtn.parentNode; parent.style.position = "relative"; // Clone the real button to create a fake disabled one var cloneBtn = realBtn.cloneNode(true); cloneBtn.disabled = true; // make it visually disabled cloneBtn.removeAttribute("onclick"); // prevent any attached JS action cloneBtn.removeAttribute("id"); // avoid duplicate IDs cloneBtn.removeAttribute("name"); // avoid being submitted in forms cloneBtn.style.cursor = "not-allowed"; // show blocked cursor on hover // Hide the real button so it cannot be triggered realBtn.style.display = "none"; // Insert the fake button into the DOM parent.appendChild(cloneBtn); // Create the tooltip with maintenance explanation in EN + DE (plain text) var hoverNotice = document.createElement("div"); hoverNotice.innerHTML = `